package com.ambow.shop.service.impl;

import java.sql.SQLException;

import com.ambow.shop.dao.UserDAO;
import com.ambow.shop.dao.impl.UserDaoJdbcImpl;
import com.ambow.shop.entity.User;
import com.ambow.shop.service.UserService;

/**
 * 用户业务接口实现。
 * 
 * @author chunw
 *
 */
public class UserServiceImpl implements UserService {
	// 此处可修改为外部注入的方式；
	private UserDAO userDao = new UserDaoJdbcImpl();

	@Override
	public boolean addUser(User user) {
		try {
			return userDao.add(user) == 1;
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}
	}

}
